package com.niiwoo.civet.user.service;

import com.niiwoo.civet.user.dto.response.ThirdAuthResponseDTO;
import com.niiwoo.civet.user.dto.response.ZhiMaScoreResponseDTO;
import com.niiwoo.civet.user.enums.UserDataStatusEnum;

import java.util.Date;

/**
 * 用户芝麻授权接口类
 *
 * @param
 * @author zzl
 * @date 2017/11/27 22:27
 * @return
 */
public interface UserAuthZhiMaDubboService {

    /**
     * 获取天秤第三方授权h5页面的url
     *
     * @param userId   用户id
     * @param createIp 用户客户端请求ip
     * @return com.niiwoo.civet.user.dto.response.ThirdAuthResponseDTO
     * @author zzl
     * @date 2017/11/22 16:20
     */
    ThirdAuthResponseDTO getThirdAuthUrl(String userId, String createIp);

    /**
     * 获取天秤芝麻分
     * @author zzl
     * @date 2018/1/5 20:42
     * @param userId  用户id
     * @return com.niiwoo.civet.user.dto.response.ZhiMaScoreResponseDTO
     */
    ZhiMaScoreResponseDTO getZhiMaScore(String userId);

    /**
     * 更新芝麻状态
     * @author zzl
     * @date 2018/1/5 20:43
     * @param userId 用户id
     * @param failureReason 失败原因
     * @param statusEnum 状态
     * @param authTime 授权时间
     * @return void
     */
    void updateZhiMaScore(String userId, String failureReason, UserDataStatusEnum.ZhimaCreditStatus statusEnum, Date authTime);

    /**
     * 保存芝麻分
     * @param userId
     * @param zhimaScore
     */
    void saveZhiMaScore(String userId, Integer zhimaScore);
}
